package com.example.myapplication.slice.slice.slice;

import com.example.myapplication.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;
import ohos.agp.components.TextField;

public class SearchAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_search);

        Button searchBtn = (Button) findComponentById(ResourceTable.Id_search_btn);
        TextField searchText = (TextField)findComponentById(ResourceTable.Id_search_textField);
        searchBtn.setClickedListener(component -> {
            //获取输入的搜索关键字
            String kw = searchText.getText();
        });
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
